package com.chief.dubbo.gateway;

import com.chief.dubbo.DubboTestGateWayService;
import com.chief.dubbo.mapper.ProductMapper;
import com.chief.openfeign.OpenFeignTestService;
import com.chief.openfeign.gateway.OpenFeignGatewayTestService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;
import java.util.Random;

@DubboService
public class DubboTestGateWayServiceImpl implements DubboTestGateWayService {

    @Autowired
    private ProductMapper productMapper;
    @Autowired
    private OpenFeignTestService openFeignTestService;
    @Autowired
    private OpenFeignGatewayTestService openFeignGatewayTestService;

    @Override
    public Map<String,Object> test() {
        Map<String, Object> res = this.productMapper.getProduct();
        res.put("random",new Random().nextInt(100));
//        res.put("test",this.openFeignTestService.openFeignTest("8888"));
//        res.put("gateway",this.openFeignGatewayTestService.test());
        return res;
    }
}
